const mongoose = require('mongoose');
const Config = require('../config/index.json');

mongoose.connect(Config.mongodb.db, (err:any) => {
    if (err) {
        console.error('connect to mongo error', Config.mongodb.db, err.message);
        process.exit(1);
    }
});

require('./models/user');

module.exports.User = mongoose.model('User');
